package jp.go.aist.six.test.util.castor;

import jp.go.aist.six.util.persist.AbstractPersistable;



/**
 * @author  Akihito Nakamura, AIST
 * @version $Id: SimpleEnumContainer.java 203 2010-12-02 03:03:07Z nakamura5akihito $
 */
public class SimpleEnumContainer
extends AbstractPersistable<String>
{

    private SimpleEnum  _simpleEnum;



    /**
     */
    public SimpleEnumContainer()
    {
    }



    /**
     */
    public void setSimpleEnum(
                    final SimpleEnum e
                    )
    {
        _simpleEnum = e;
    }


    /**
     */
    public SimpleEnum getSimpleEnum()
    {
        return _simpleEnum;
    }



    //**************************************************************
    //  java.lang.Object
    //**************************************************************

    /**
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode()
    {
        final int  prime = 37;
        int  result = 17;

        SimpleEnum  ep = getSimpleEnum();
        result = prime * result + ((ep == null) ? 0 : ep.hashCode());

        return result;
    }



    /**
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(
                    final Object obj
                    )
    {
        if (this == obj) {
            return true;
        }

        if (!(obj instanceof SimpleEnumContainer)) {
            return false;
        }

        SimpleEnumContainer  other = (SimpleEnumContainer)obj;
        SimpleEnum  other_ep = other.getSimpleEnum();
        SimpleEnum   this_ep =  this.getSimpleEnum();
        if (this_ep == other_ep) {
                return true;
        }

        return false;
    }



    @Override
    public String toString()
    {
        return "EnumContainer["+ getSimpleEnum() + "]";
    }

}
// SimpleEnumContainer

/* vim:set tabstop=4:set expandtab:set shiftwidth=4: */

